<template>

  <div class="questions-body">

  <div class="top-tis">
    <Breadcrumb>
          <Breadcrumb-item>你当前位置</Breadcrumb-item>
          <Breadcrumb-item href="/index">首页</Breadcrumb-item>
          <Breadcrumb-item  href="/questions">问与答</Breadcrumb-item>
      </Breadcrumb>
  </div>  

  <div class="questions-view">
  
  </div>

     <div class="more-recommend category" v-if="questions">

        <div class="article">

          <div class="active-title">

              <p class="article-title" > {{title}} </p>
              <p class="article-title" > {{englishTitle}} </p>

              <p class="article-message">
                  来源：<span v-if="questions.statute"> <Tag v-for="(item,index) in questions.statute.data" :key="index">{{ item.name }}</Tag></span>
                  <Tag v-else>暂无来源</Tag>
                  <br>
                  <span> {{inTimes}}</span>

              </p>
            
          </div>

          <p class="article-content" v-html="chineseContent"></p>
          <p class="article-content" v-html="englishContent"></p>

        </div>

    </div>

    <router-link style="background:#fff;font-size:14px;color:#2d8cf0;" class="term-herf" :to="{path: '/questions'}">返回</router-link>

  </div>
</template>
<style scoped>
   
@import '../../assets/css/ccm.css';
.article {
    width: 90%;
    margin: 12px auto;
}
</style>

<script>


export default {
  components:{
    },
          
  data(){

    return {

      chineseContent:'',
      englishContent:'',
      title:'',
      inTimes:'',
      questions: null,
      
    }

  },
  created() {

    this.getCarousel();

  },

  methods:{

    getCarousel(){

      this.$store.commit('mainLoading', true);

      this.$http.get('/questions/'+ this.$route.query.id + "?include=statute").then(
        questionslist => {

          this.chineseContent = questionslist.data.data.content;
          this.englishContent = questionslist.data.data.english_content;

          this.englishTitle = questionslist.data.data.english_title;
          this.title = questionslist.data.data.title;

          this.inTimes = questionslist.data.data.inTimes;
          this.questions = questionslist.data.data;
          this.$store.commit('mainLoading', false);


          }).catch(err => {

            this.$Message.error( 'termlist');
        
        })
    },
      
  }
}
</script>

